package cn.jiyun.dao;

import cn.jiyun.pojo.Role;
import cn.jiyun.pojo.Teacher;
import cn.jiyun.pojo.User;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface TeacherDao extends Mapper<Teacher> {
    Page<Teacher> findPage(String queryString);

    void add(Teacher teacher);

    @Select("select count(*) from ts where tid=#{id}")
    Integer findByTid(Integer id);

    User findByUserName(String username);

    @Select("select r.* from role r,ur u where r.id=u.rid and u.uid=#{id}")
    List<Role> findByUid(Integer id);
}
